---
name: useLog
menu: Logger
route: /use-log
---

import { useState } from "react";
import { Playground } from "docz";
import { Inspector, useLog } from "../../src/lib";

### useLog(label, value)

Displays the value in the inspector panel

- `label` - A label for the log
- `value` - The value that should be displayed.

#### Usage

```javascript
import { useLog } from "retoggle";
```

<Playground>
{() => {
    const [state, setState] = useState({value: 5});
    useLog('Value', state);

    return (
        <React.Fragment>
            <Inspector usePortal={false}/>
            {state.value}
        </React.Fragment>
    )

}}

</Playground>
